import { IntersectionType, OmitType, PartialType, PickType } from '@nestjs/swagger'
import { ListPaginationDto } from '@/shared/types/globalDto.dto'
import { Question } from '../entities/question.entity'

export class EnableQuestionDto extends PickType(Question, ['questionId']) {}

export class CreateQuestionDto extends OmitType(Question, ['questionId', 'createdAt', 'updatedAt']) {}

export class UpdateQuestionDto extends PartialType(CreateQuestionDto) {}

export class FindOneQuestionDto extends PartialType(OmitType(Question, ['questionList'])) {}

export class ListPageQuestionDto extends PartialType(IntersectionType(FindOneQuestionDto, ListPaginationDto)) {}

export class WebListPageQuestionDto extends ListPageQuestionDto {}

export class ListPageQuestionVo {
  total: number
  pageNo: number
  pageSize: number
  list: Question[]
}
